<?PHP 
include("config.php");
 ?>
 <?PHP include("config.php");
require_once "sql_inject.php"; 
$bDestroy_session = TRUE; 
$url_redirect = 'index.php'; 
$sqlinject = new sql_inject('./log_file_sql.log',$bDestroy_session,$url_redirect)  ; 
require 'config.php';
?>
<script language="JavaScript">
 function blockError(){return true;}
 window.onerror = blockError;
 </script>
<script language=JavaScript>
 function disableselect(e) {
    return false
 } 
 function reEnable() {
    return true
 }
 //if IE4+
 document.onselectstart=new Function ("return false")
 //if NS6
 if (window.sidebar) { 
    document.onmousedown=disableselect
    document.onclick=reEnable
 }
 </script>
<SCRIPT language=JavaScript>
<!--

var message="Gosto do site né safado! ta querendo copiar o que?";


function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// --> 
</SCRIPT>
<?
$name = stripslashes($_POST['name']);
require'config.php';
include_once('sql_check.php');
check_inject();
$name = stripslashes($_POST['name']);

$msconnect=mssql_connect("$dbhost","$dbuser","$dbpasswd");
$msdb=mssql_select_db("MuOnline",$msconnect);

require_once "sql_inject.php"; 
$bDestroy_session = TRUE; 
$url_redirect = 'index.php'; 
$sqlinject = new sql_inject('./log_file_sql.log',$bDestroy_session,$url_redirect)  ; 

if ((eregi("[^a-zA-Z0-9_-]", $name)) ) 
	{
	echo("SQL Injection Detected");
        exit();
	}
$query = "SELECT  Name,Class,cLevel,Resets,MapNumber from Character where name like '%$name%'";
$result = mssql_query($query);
if (empty($name)){
	echo "<font color='red'>Error: Coloque o nome do personagem antes de executar a busca.</font>";}


echo '<TABLE border=0 cellPadding=0 cellSpacing=0 >
                          <TBODY>
                          <TR>
                            
                         
    <TD align=left vAlign=top><A 
                               
                              
  </TR>
                          <TR>
                            <TD align=left  
                            vAlign=top>
                              <TABLE border=0 cellPadding=10 cellSpacing=0 
                            
                                <TBODY>
                                <TR>
                                
          <TD align=middle vAlign=center><span
                                class=main_cont>O personagem solicitado foi esse:</span>
            <table height=30 cellspacing=0 cellpadding=3
                                width=300 border=1 >
              <tbody
              <tr> 
                
                <td valign=top align=left width=6>Name</td>
                <td valign=top align=left width=6>Classe</td>
                <td valign=top align=left width=6>Level</td>
                <td valign=top align=left width=6>Resets</td>
                <td valign=top align=left width=6>Location</td>
</tr>';

for($i=0;$i < mssql_num_rows($result);++$i)
{
$row = mssql_fetch_row($result);
$rank = $i+1;
if($row[1] == 0){ $row[1] =  'DW';
}
if($row[1] == 1){ $row[1] =  'SM';
}
if($row[1] == 16){ $row[1] =  'DK';
}
if($row[1] == 17){ $row[1] =  'BK';
}
if($row[1] == 32){ $row[1] =  'Elf';
}
if($row[1] == 33){ $row[1] =  'ME';
}
if($row[1] == 48){ $row[1] =  'MG';
}
if($row[1] == 64){ $row[1] =  'DL';
}
if($row[8] == 0){ $row[8] =  'Lorencia';
}
if($row[8] == 1){ $row[8] =  'Dungeon';
}
if($row[8] == 2){ $row[8] =  'Davias';
}
if($row[8] == 3){ $row[8] =  'Noria';
}
if($row[8] == 4){ $row[8] =  'Losttower';
}
if($row[8] == 8){ $row[8] =  'Tarkan';
}
if($row[8] == 7){ $row[8] =  'Atlans';
}
if($row[8] == 6){ $row[8] =  'Arena';
}
echo "
                <td valign=top align=left>$row[0]</td>
                <td valign=top align=left>$row[1]</td>
                <td valign=top align=left>$row[2]</td>
                <td valign=top align=left>$row[3]</td>
				<td valign=top align=left>$row[8]</td>
</tr>";
}
?>
                  </tbody> 
                </table>
				
				</TD>
        </TR></TBODY></TABLE></TD></TR>
        <link href="../style.css" rel="stylesheet" type="text/css">
        <link href="style.css" rel="stylesheet" type="text/css">
        
                          <TR>
                             
                          </TD></TR></TBODY></TABLE>
